package com.huatai.user.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import java.time.LocalDateTime;

/**
 * @program: ht-system
 * @description: 资源权限表
 * @author: songxiude
 * @create: 2023-02-09 15:42
 **/
@TableName("sys_permission")
@ApiModel(value = "资源权限实体",description = "资源权限实体")
@Data
public class Permission {
	@TableId
	@ApiModelProperty("资源主键id")
	private Long id;

	@TableField("permission_name")
	@ApiModelProperty(value = "资源名称（菜单、接口）",required = true)
	@NotBlank(message = "资源名称不能为空")
	private String permissionName;

	@TableField("parent_id")
	@ApiModelProperty("父级id")
	private Long parentId;

	@TableField("sort")
	@ApiModelProperty("排序")
	private Integer sort;

	@TableField("rute_path")
	@ApiModelProperty("路由路径（菜单、接口、按钮）")
	@NotBlank(message = "路由路径不能为空")
	private String rutePath;

	@ApiModelProperty("前端文件路径")
	private String component;

	@TableField("permission_type")
	@ApiModelProperty("资源类型（1菜单2接口3按钮4系统）")
	private Integer permissionType;

	@TableField("is_show")
	@ApiModelProperty("是否显示0显示1隐藏")
	private Integer isShow;

	@TableField("is_homepage")
	@ApiModelProperty("是否设置为首页0否1是")
	private Integer isHomepage;

	@TableField("permission_key")
	@ApiModelProperty("权限标识key如：USER_DEL")
	@NotBlank(message = "权限标识不能为空")
	private String permissionKey;

	@TableField("icon")
	@ApiModelProperty("前端菜单图标")
	private String icon;

	@TableField("create_userid")
	@ApiModelProperty("创建人id")
	private Long createUserid;

	@TableField(value = "create_time",fill = FieldFill.INSERT)
	@ApiModelProperty("创建时间")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone="GMT+8")
	private LocalDateTime createTime;

	@TableField("update_userid")
	@ApiModelProperty("更新人id")
	private Long updateUserid;

	@TableField(value = "update_time",fill = FieldFill.INSERT_UPDATE)
	@ApiModelProperty("更新时间")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone="GMT+8")
	private LocalDateTime updateTime;

	@TableField("remark")
	@ApiModelProperty("备注信息")
	private String remark;

}

